<template>
  <el-card class="follow-page">
    <follow-list v-if="showList" :list="followerList" :isFollowing="isFollowing"></follow-list>
  </el-card>
</template>

<script>
import { getFollowerList } from "@/api/relations";
import FollowList from "@/components/FollowList";
export default {
  data() {
    return {
      isFollowing: false,
      followerList: [],
      showList: false,
      uid: 0,
    };
  },
  methods: {
    _getFollowerList() {
      getFollowerList(this.uid).then((res) => {
        if (res.data.code === 200) {
          if (res.data.msg === "没有粉丝") {
            this.$message(res.data.msg);
            return;
          }
          this.followerList = res.data.data.data;
          this.showList = true;
        }
      });
    },
  },
  created() {
    this.uid = this.$route.params.uid;
    this._getFollowerList();
  },
  components: {
    "follow-list": FollowList,
  },
};
</script>

<style>
.follow-page {
  min-height: 500px;
}
</style>